]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-button: Handle touch-cancel events
authorverdre <verdre@v0yd.nl>
Fri, 18 Jan 2019 08:37:04 +0000 (09:37 +0100)
committerCarlos Garnacho <mrgarnacho@gmail.com>
Fri, 25 Jan 2019 10:31:41 +0000 (10:31 +0000)
Handling those events is neccessary if a touch event that pressed down a
button turns out to be a gesture. In this case the button should be
released without emitting the clicked signal.

src/st/st-button.c

index a3a7b2442e16cc59855df858cf52e0f5398ceb96..a95ddff2dc627bfd67de02a411b7b4086d4c48c0 100644 (file)
@@ -262,6 +262,10 @@ st_button_touch_event (ClutterActor      *actor,
       clutter_input_device_sequence_ungrab (device, sequence);
       return CLUTTER_EVENT_STOP;
     }
+  else if (event->type == CLUTTER_TOUCH_CANCEL)
+    {
+      st_button_fake_release (button);
+    }
 
   return CLUTTER_EVENT_PROPAGATE;
 }